1. Field of the Invention
The present invention relates to apparatus and method for an information encoding for performing inter-frame prediction on the basis of motion compensation and intra-frame encoding.
The present invention also relates to apparatus and method for a fade detecting in the information encoding apparatus and method.
2. Description of the Related Art
There are various encoding methods proposed for use of encoding information, especially digital information, which is, for example, stored on a recording medium, or transmitted on a broadcast wave. However, MPEG (moving picture coding expert group) standard is used for recording a moving-picture data on a DVD having about seven times capacity as compared with that of a conventional recording medium such as a CD (Compact disk).
The MPEG standard is an encoding system in which DCT(Discrete Cosine Transform), motion compensation prediction and variable length encoding are combined to carry out compression of an enormous amount of picture data efficiently. DCT processing is performed with respect to predictive error data which is determined as a difference between a current objective frame and a forward or a backward reference frame delivered by means of motion compensation. Then the predictive error data encoded by a DCT is quantized. Additionally, motion vector detection is performed. In the MPEG standard, the frame is divided into macroblocks. Each macroblock includes 16 pixels.times.16 pixels. In the case where any motion is detected every macroblock between the reference frame and the current objective frame, a direction and an amount of the motion is indicated as a motion vector. Then a predictive picture is generated on the basis of the motion vector, the difference at a macroblock between the predictive picture and a reference picture, which generates the motion, is calculating. Further, the difference is encoded by variable length encoding. In this manner, an enormous amount of picture data is compressed efficiently.
However, according to a conventional compression method, in the case where both of a monotonous picture and a complicated picture are compressed at same compression ratio, the complicated picture is compressed so excessively that the compressed complicated picture declines. Therefore, a deterioration of picture quality is occurred.
For example, when a picture having a change of a luminance, so called a fade, whose value of luminance is changed in one direction such as from minimum to maximum and vice versa, is compressed at low bit rate on the basis of MPEG standard, It is known that xe2x80x9cblock distortionxe2x80x9d is often generated.
Therefore, in the conventional compression method, a fade deteccting is executed. If the fade is detected, the bit rate is adapted to the fade, or a motion compensation is adapted to the fade.
However, in the conventional fade detection method, the fade detection is executed by means of calculating an accumulation of value of luminance in each field is calculated, and measuring a change of the accumulation in time domain for several fields. Then fade is determined when the accumulation changes gradually.
In the case of measuring a change of the accumulation in time domain, a delay of frame is occurred until fade is detected, so that some memories for storing the delayed frame are required in order to encode the fade after detected.
Additionally, in accordance with this conventional fade detection method, a scene change or a complicated picture might be detected as fade in error because the fade detection is executed on the basis of a change of value of luminance at each field.
It is therefore an object of the present invention to provide method and apparatus for a fade detecting, and an information encoding, which are capable to detect fade exactly without extra memories for a fade detecting.
The above object of the present invention can be achieved by an apparatus for detecting fade transitions in image data used for image data compression. The apparatus has an inter-frame difference calculation device, a pixel block detection device, an predictive difference calculation device, and a judging device. The inter-frame difference calculation device calculates an absolute value of a difference at each pixel between two frames, and a sum of absolute values of differences at all pixels of one frame. The pixel block detection device calculates an absolute value of a difference at each pixel between two pixel blocks. Each of block is subdivided from one frame. And the pixel block detection device detects a pair of blocks to obtain the minimum value for a sum of absolute values of differences at all pixels of one block. The predictive difference calculation device calculates a total of sums of the absolute values of differences at all pixels of one block in each pair of blocks, which is detected by the pixel block detection device, for one frame. The judging device judges whether the fade transitions are generated or not, on the basis of the sum of the absolute values at all pixels of one frame, which is calculated by the inter-frame difference calculation device, and the total, which is calculated by the predictive difference calculation device.
According to the fade detecting apparatus of the present invention, the inter-frame difference calculation device calculates an absolute value of a difference, such as luminance, chrominance and the like, at each pixel between two frames. Then the inter-frame difference calculation device calculates a sum of absolute values of differences at all pixels of one frame. Therefore, a correlation between the two frames is obtained, a picture having a high correlation is distinguish from a picture having a low correlation. Next, the pixel block detection device calculates an absolute value of a difference at each pixel between two pixel blocks. Each of block is subdivided from one frame, called macroblock. And the pixel block detection device detects a pair of blocks to obtain the minimum value for a sum of absolute values of differences at all pixels of one block. The predictive difference calculation device calculates a total of sums of the absolute values of differences at all pixels of one block in each pair of blocks, which is detected by the pixel block detection device, for one frame. Therefore, the correlation is obtained every macro block, so that, in the case where a picture has some motion, the correlation between the frame is calculated accurately. Next, the judging device judges whether the fade transitions are generated or not, on the basis of the sum of the absolute values at all pixels of one frame, which is calculated by the inter-frame difference calculation device, and the total, which is calculated by the predictive difference calculation device. That is, both a correlation between two frames and a correlation between the two blocks are used for a fade deteccting. First, a fade picture and a normal picture are accurately distinguished from a scene change and a complicated picture, whose correlation between two frames is lower than the normal and the fade pictures, on the basis of a correlation between two frames. Next, a fade picture is accurately distinguished from a normal picture, which has much more motion than the normal picture on the basis of a correlation between the two blocks. Therefore, a fade picture, whose luminance changes toward one direction at a certain rate for a whole frame, is accurately detected without a detection error.
In one aspect of the fade detecting apparatus of the present invention, the judging device has a first compare device and a second compare device. And the judging device judges that the fade transitions are generated in the case where such a status that the sum is smaller than the first reference value as a result of comparing by the first compare device, and the total is greater than the second reference value as a result of comparing by the second compare device, is continued for a plurality of frames.
According to this aspect, the judging device compares the sum of the absolute values at all pixels of one frame with a first reference value by using the first compare device. In the case where the sum is smaller than the first reference value as a result of comparing by the first compare device, the judging device judges that a current picture is a fade picture or a normal picture. Next, the judging device compares the total with a second reference value by using the first compare device. In the case where the total is greater than the second reference value as a result of comparing by the second compare device, the judging device judges that a current picture is a scene change, a fade picture, or a complicated picture. Therefore, in the case where such a status that the sum is smaller than the first reference value , and the total is greater than the second reference value, there is high possibility that the current picture is a fade picture. Further, sometimes a scene change meets that condition. However, in a fade picture, that status is continued for a plurality of frames, while in a scene change that status can be not continued. Then, in the case where such a status that the sum is smaller than the first reference value, and the total is greater than the second reference value is continued for a plurality of frames, the judging device judges that the fade transitions are generated. Therefore, a fade picture is accurately detected without a detection error as a complicated picture, a scene change, or a normal picture.
In another aspect of the fade detecting apparatus of the present invention, the judging device has a first compare device and a second compare device. And the judging device judges that the fade transitions are generated in the case where such a status that said sum is smaller than the first reference value as a result of comparing by the first compare device, and the total is greater than the second reference value as a result of comparing by the second compare device, is continued for a plurality of frames. Further, the first reference is a border value between said total in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated. And the second reference is a border value between said frame total in the frame where a fade transition or a scene change is generated and said total in the frames where a normal picture is generated.
According to this aspect, the judging device compares the sum of the absolute values at all pixels of one frame with a first reference value by using the first compare device. Further, the first reference is a border value between the total in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated. In the case where the sum is smaller than the first reference value as a result of comparing by the first compare device, the judging device judges that a current picture is a fade picture or a normal picture. Next, the judging device compares the total with a second reference value by using the first compare device. Further, the second reference is a border value between the frame total in the frame where a fade transition or a scene change is generated and the total in the frames where a normal picture is generated. In the case where the total is greater than the second reference value as a result of comparing by the second compare device, the judging device judges that a current picture is a scene change or a fade picture. Therefore, in the case where such a status that the sum is smaller than the first reference value, and the total is greater than the second reference value, there is high possibility that the current picture is a fade picture. Therefore, a fade picture is accurately detected without a detection error as a complicated picture, a scene change, or a normal picture.
The above object of the present invention can be achieved by an apparatus for information encoding. The apparatus has a fade detecting device, a rearrange device, a discrete cosine transform device, a quantize device, a encoding device, an inverse quantize device, an inverse discrete cosine transform device, a motion compensation device, and an operation device. And the inter-frame difference calculation device calculates the sum on the basis of the frame memory of the rearrange device. Further, the predictive difference calculation device calculates the total on the basis of said frame memory of said motion compensation device.
According to this aspect, first, a rearrange device rearranges source frames in a encode processing sequence on the basis of a frame memory. Next, a discrete cosine transform device performs discrete cosine transform processing for image data rearranged. Then, a quantize device quantizes the image data transformed by the discrete cosine transform device on the basis of prescribed quantize scale code. Then, a encoding device performs variable length encode processing for the quantized image data. Then, an inverse quantize device converts the quantized image data into image data. Then, an inverse discrete cosine transform device performs inverse direct cosign transform processing for image data converted by the inverse quantize device. Further, a motion compensation device has a frame memory, and detects a motion vector on the basis of the image data transformed by the inverse discrete cosine transform device and the new objective image data. Further more, a motion compensation device performs motion compensation processing for the image data transformed by the inverse discrete cosine transform device on the basis of the motion vector. Moreover, the inter-frame difference calculation device calculates an absolute value of a difference, such as luminance, chrominance and the like, at each pixel between two frames. Then the inter-frame difference calculation device calculates a sum of absolute values of differences at all pixels of one frame on the basis of the frame memory of the rearrange device. Therefore, a correlation between the two frames is obtained, a picture having a high correlation is distinguish from a picture having a low correlation. Next, the pixel block detection device calculates an absolute value of a difference at each pixel between two pixel blocks on the basis of the frame memory of the motion compensation device. Each of block is subdivided from one frame, called macroblock. And the pixel block detection device detects a pair of blocks to obtain the minimum value for a sum of absolute values of differences at all pixels of one block. The predictive difference calculation device calculates a total of sums of the absolute values of differences at all pixels of one block in each pair of blocks, which is detected by the pixel block detection device, for one frame. Therefore, the correlation is obtained every macro block, so that, in the case where a picture has some motion, the correlation between the frame is calculated accurately. Next, the judging device judges whether the fade transitions are generated or not, on the basis of the sum of the absolute values at all pixels of one frame, which is calculated by the inter-frame difference calculation device, and the total, which is calculated by the predictive difference calculation device. That is, both a correlation between two frames and a correlation between the two blocks are used for a fade deteccting. First, a fade picture and a normal picture are accurately distinguished from a scene change and a complicated picture, whose correlation between two frames is lower than the normal and the fade pictures, on the basis of a correlation between two frames. Next, a fade picture is accurately distinguished from a normal picture, which has much more motion than the normal picture on the basis of a correlation between the two blocks. Therefore, a fade picture, whose luminance changes toward one direction at a certain rate for a whole frame, is accurately detected without a detection error. Further, a frame memory only for a fade deteccting is not required. The frame memory for the rearrange device and the motion compensation device is used for a fade deteccting. Therefore, a cost of production can be reduced.
In one aspect of the encoding apparatus of the present invention, the judging device has a first compare device and a second compare device. And the judging device judges that the fade transitions are generated in the case where such a status that the sum is smaller than the first reference value as a result of comparing by the first compare device, and the total is greater than the second reference value as a result of comparing by the second compare device, is continued for a plurality of frames.
According to this aspect, the judging device compares the sum of the absolute values at all pixels of one frame with a first reference value by using the first compare device. In the case where the sum is smaller than the first reference value as a result of comparing by the first compare device, the judging device judges that a current picture is a fade picture or a normal picture. Next, the judging device compares the total with a second reference value by using the first compare device. In the case where the total is greater than the second reference value as a result of comparing by the second compare device, the judging device judges that a current picture is a scene change, a fade picture, or a complicated picture. Therefore, in the case where such a status that the sum is smaller than the first reference value, and the total is greater than the second reference value, there is high possibility that the current picture is a fade picture. Further, sometimes a scene change meets that condition. However, in a fade picture, that status is continued for a plurality of frames, while in a scene change that status can be not continued. Then, in the case where such a status that the sum is smaller than the first reference value, and the total is greater than the second reference value is continued for a plurality of frames, the judging device judges that the fade transitions are generated. Therefore, a fade picture is accurately detected without a detection error as a complicated picture, a scene change, or a normal picture. The frame memory for the rearrange device and the motion compensation device is used for a fade deteccting. Therefore, a cost of production can be reduced.
In another aspect of the encoding apparatus of the present invention, the judging device has a first compare device and a second compare device. And the judging device judges that the fade transitions are generated in the case where such a status that said sum is smaller than the first reference value as a result of comparing by the first compare device, and the total is greater than the second reference value as a result of comparing by the second compare device, is continued for a plurality of frames. Further, the first reference is a border value between said total in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated. And the second reference is a border value between said frame total in the frame where a fade transition or a scene change is generated and said total in the frames where a normal picture is generated. The frame memory for the rearrange device and the motion compensation device is used for a fade deteccting. Therefore, a cost of production can be reduced.
According to this aspect, the judging device compares the sum of the absolute values at all pixels of one frame with a first reference value by using the first compare device. Further, the first reference is a border value between the total in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated. In the case where the sum is smaller than the first reference value as a result of comparing by the first compare device, the judging device judges that a current picture is a fade picture or a normal picture. Next, the judging device compares the total with a second reference value by using the first compare device. Further, the second reference is a border value between the frame total in the frame where a fade transition or a scene change is generated and the total in the frames where a normal picture is generated. In the case where the total is greater than the second reference value as a result of comparing by the second compare device, the judging device judges that a current picture is a scene change or a fade picture. Therefore, in the case where such a status that the sum is smaller than the first reference value, and the total is greater than the second reference value, there is high possibility that the current picture is a fade picture. Therefore, a fade picture is accurately detected without a detection error as a complicated picture, a scene change, or a normal picture. The frame memory for the rearrange device and the motion compensation device is used for a fade deteccting. Therefore, a cost of production can be reduced.
In another aspect of the encoding apparatus of the present invention, the encoding device performs compression encoding processing in MPEG2 standard.
According to this aspect, the encoding device performs compression encoding processing to image data at prescribed encoding rate in MPEG2 standard. Therefore, image data is compressed without occurring deterioration of quality of picture.
The above object of the present invention can be achieved by a method for detecting fade transitions in image data signal used for image data compression. This method includes processes as follows: calculating an absolute value of a difference at each pixel between two frames, and a sum of absolute values of differences at all pixels of one frame; calculating an absolute value of a difference at each pixel between two pixel blocks, each of which is subdivided from one frame, and detecting a pair of blocks to obtain the minimum value for a sum of absolute values of differences at all pixels of one block; calculating a total of sums of the absolute values of differences at all pixels of one block in each pair of blocks detected; and judging whether said fade transitions is generated or not, on the basis of said sum of the absolute values at all pixels of one frame and said total.
According to the fade detecting method of the present invention, the same advantageous effect of the aforementioned detecting apparatus of the invention can be achieved.
In one aspect of the fade detecting method of the present invention, the judging process provided with a comparing process of a sum of the absolute values at all pixels of one frame with a first reference value, and comparing process of the total with a second reference value, and the judging process of that the fade transitions are generated in the case where such a status that the sum is smaller than said first reference value as a result of said comparing process, and the total is greater than said second reference value as a result of the comparing process, is continued for a plurality of frames.
According to the fade detecting method of the present invention, the same advantageous effect of the aforementioned detecting apparatus of the invention can be achieved.
In another aspect of the fade detecting method of the present invention, in the judging process provided with: comparing process of the sum of the absolute values at all pixels of one frame with a first reference value; and comparing process of the total with a second reference value, the judging process of that the fade transitions are generated in the case where such a status that the sum is smaller than the first reference value as a result of the comparing process, and the total is greater than the second reference value as a result of the comparing process, is continued in a plurality of frames, the first reference is a border value between the sum in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated; and the second reference is a border value between the total in the frame where a fade transition or a scene change is generated and the total in the frames where a normal picture is generated.
According to the fade detecting method of the present invention, the same advantageous effect of the aforementioned detecting apparatus of the invention can be achieved.
The above object of the present invention can be achieved by a method for information encoding. This method includes processes as follows: (a) detecting fade transitions in image data used for image data compression provided with: calculating an absolute value of a difference at each pixel between two frames, and a sum of absolute values of differences at all pixels of one frame; calculating an absolute value of a difference at each pixel between two pixel blocks, each of which is subdivided from one frame, and detecting a pair of blocks to obtain the minimum value for a sum of absolute values of differences at all pixels of one block; calculating a total of sums of the absolute values of differences at all pixels of one block in each pair of blocks detected, for one frame; and judging whether said fade transitions are generated or not, on the basis of said sum of the absolute values at all pixels of one frame and said total, (b) rearranging source frames in a encode processing sequence on the basis of a frame memory, (c) performing discrete cosine transform processing for image data, (d) quantizing said image data transformed by said discrete cosine transform process on the basis of prescribed quantize scale code, (e) performing variable length encode processing said quantized image data, (f) converting said quantized image data into image data, (g) performing inverse direct cosign transform processing for image data converted by said inverse quantize process, (h) detecting a motion vector on the basis of said image data transformed by said inverse discrete cosine transform process and the new objective image data, and performing motion compensation processing for said image data transformed by said inverse discrete cosine transform process on the basis of said motion vector, (i) calculating a difference between a source image data and a predictive data generated by said motion compensation process, (j) said calculating process of said sum is on the basis of said frame memory, and (k) said calculating process of said total is on the basis of said frame memory.
According to the information encoding method of the present invention, the same advantageous effect of the aforementioned encoding apparatus of the invention can be achieved.
In one aspect of the information encoding method of the present invention, the judging process provided with: a comparing process of the sum of the absolute values at all pixels of one frame with a first reference value; and a comparing process of the total with a second reference value, and the judging process of that said fade transitions are generated in the case where such a status that the total is smaller than the first reference value as a result of the comparing process, and the total is greater than the second reference value as a result of said comparing process, is continued for a plurality of frames.
According to the information encoding method of the present invention, the same advantageous effect of the aforementioned encoding apparatus of the invention can be achieved.
In another aspect of the information encoding method of the present invention, in the judging process provided with: comparing process the sum of the absolute values at all pixels of one frame with a first reference value; and comparing the total with a second reference value, the judging process of that the fade transitions are generated in the case where such a status that the sum is smaller than the first reference value as a result of the comparing process, and the total is greater than the second reference value as a result of the comparing process, is continued for a plurality of frames, the first reference is a border value between the sum in the frames where at least a scene change is generated and the total in the frames where a fade transition or a normal picture is generated, and the second reference is a border value between the total in the frame where a fade transition or a scene change is generated and the total in the frames where a normal picture is generated.
According to the information encoding method of the present invention, the same advantageous effect of the aforementioned encoding apparatus of the invention can be achieved.
In another aspect of the information encoding method of the present invention, the encoding device performs compression encoding processing in MPEG2 standard.
According to the information encoding method of the present invention, the same advantageous effect of the aforementioned encoding apparatus of the invention can be achieved.